import java.util.Scanner;

public class homework27 {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in); //键盘键入
        System.out.println("输入s1:");
        String s1 = in.next();
        System.out.println("输入s2:");
        String s2 = in.next();
        int index = 0;//索引的位置开始找起
        int length = s2.length();//字符串的长度
        int count = 0;//计包含的个数
        while (index < s1.length()) {  //索引长度不超过字符串的长度
            if (s1.indexOf(s2, index) != -1) { //判断
                index = s1.indexOf(s2, index) + length;
                count++;    //包含的个数加1
            } else {
                break;
            }
        }
        System.out.println("s1 中包含" + count + "个 s2");
    }
}